// import { DECREMENT, INCREMENT } from "../const/counter.const"
// import { HIDEMODEL, SHOWMODEL } from "../const/model.const"

// let initialState = { count: 0, showStatus: false }

// export const reducer= (state = initialState, action) => {
//     switch (action.type) {
//         case INCREMENT:
//             return { ...state, count: state.count + action.payLoad }
//         case DECREMENT:
//             return { ...state, count: state.count - action.payLoad }
//         case SHOWMODEL:
//             return {
//                 ...state,
//                 showStatus: true
//             }
//         case HIDEMODEL:
//             return {
//                 ...state,
//                 showStatus: false
//             }
//         default:
//             return state
//     }
// }
import { handleActions as createReducer } from "redux-actions";
import { increment, decrement } from "../actions/counter.actions"
const initialState = { count: 0, showStatus: false }
const handleIncrement = (state, action) => ({ count: state.count + action.payload })
const handleDncrement = (state, action) => ({ count: state.count - action.payload })
export default createReducer({
    [increment]: handleIncrement,
    [decrement]: handleDncrement
}, initialState)